package com.gzu.finalwork.entity.user;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Document(collection = "delivery_tracks")
public class DeliveryTrack {
    @Id
    private String id;
    @Field("delivery_order_id")
    private Long deliveryOrderId;
    
    @Field("order_number")
    private String orderNumber;
    @Field("track_records")
    private List<TrackRecord> trackRecords;
    
    @Field("created_at")
    private LocalDateTime createdAt;
    
    @Field("updated_at")
    private LocalDateTime updatedAt;
    
    @Data
    public static class Location {
        private Double longitude; // 经度
        private Double latitude;  // 纬度
        private String address;   // 地址描述

    }
    
    @Data
    public static class TrackRecord {
        private LocalDateTime timestamp;//时间
        private Integer status;//物流状态// 1-已下单 2-待揽件 3-已揽件 4-运输中 5-已到达 6-已签收
        private String description;//物流描述
        private Location location;//位置信息
        private String operator;  // 配送员
        private String remark;    // 备注
    }
}